<?php

namespace Drupal\ssystore\ViewsController;

use Drupal\ssystore\ViewsController\handler\field\SsystoreEditLinkViewsField;


class SsystoreViewsController extends \EntityDefaultViewsController {

  public function views_data() {
    $data = parent::views_data();
    if (!empty($this->info['base table'])) {
      $table = $this->info['base table'];
      $revision_table = $this->info['revision table'];

      $info = [];

      $info[$table]['edit_link'] = [
        'title' => t('编辑'),
        'help' => t('编辑.'),
        'field' => [
          'handler' => SsystoreEditLinkViewsField::class,
        ],
      ];
      $info[$table]['channertype'] = [
        'title' => '了解渠道 online 线上广告',
        'help' => '了解渠道 online 线上广告',
        'real field' => 'channertype',
        'field' => [
          'handler' => \Drupal\ssystore\ViewsController\handler\field\SsystoreChannertypeViewsField::class,
        ],
        'filter' => [
          'handler' => \Drupal\ssystore\ViewsController\handler\filter\SsystoreChannertypeViewsFilter::class,
        ],
      ];
      $info[$revision_table]['channertype'] = [
        'title' => '了解渠道 online 线上广告',
        'help' => '了解渠道 online 线上广告',
        'real field' => 'channertype',
        'field' => [
          'handler' => \Drupal\ssystore\ViewsController\handler\field\SsystoreChannertypeViewsField::class,
        ],
        'filter' => [
          'handler' => \Drupal\ssystore\ViewsController\handler\filter\SsystoreChannertypeViewsFilter::class,
        ],
      ];
      $data = drupal_array_merge_deep($data, $info);
    }
    return $data;
  }

}
